package com.maxwell.googleplay.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.cache.MD5FileNameGenerator;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.maxwell.googleplay.R;
import com.maxwell.googleplay.bean.SubjectInfoBean;
import com.maxwell.googleplay.conf.Constants.URL;
import com.maxwell.googleplay.utils.BitmapHelper;
import com.maxwell.googleplay.utils.UIUtils;

/**
 * @author yue
 * @创建时间 2016-4-1下午7:33:11
 * @描述 TODO
 * 
 */
public class SubjectHolder extends BaseHolder<SubjectInfoBean> {

	@ViewInject(R.id.item_subject_tv_title)
	TextView mTvTitle;
	@ViewInject(R.id.item_subject_iv_icon)
	ImageView mIvIcon;

	@Override
	public View initHolderView() {
		View view = View.inflate(UIUtils.getContext(), R.layout.item_subject,
				null);

		ViewUtils.inject(this, view);

		return view;
	}

	@Override
	public void refreshHolderView(SubjectInfoBean data) {
		mTvTitle.setText(data.des);
		mIvIcon.setImageResource(R.drawable.ic_default);
		BitmapHelper.display(mIvIcon, URL.IMAGEBASEURL + data.url);

	}

}
